<?php
/* @var $this QuotationOrderHeaderController */
/* @var $model QuotationOrderHeader */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'quotation-order-header-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'quotation_no'); ?>
		<?php echo $form->textField($model,'quotation_no',array('value'=>$quo_no,'readonly'=>'readonly','size'=>50,'maxlength'=>50)); ?>
		<?php //echo $form->error($model,'quotation_no'); ?>
	</div>
    
    <div class="row">
		<?php echo $form->labelEx($model,'product_pn'); ?>

		<!-- <input type='textfield' name='[QuotationOrderDetail][product_pn]' id='product_pn' maxlength='40' size='40' value='<?php echo $model->product_pn; ?>'> -->
		<?php echo $form->textField($model,'product_pn',array('id'=>'product_pn','size'=>40,'maxlength'=>40, 'readonly'=>'readonly' )); ?>
		<?php //echo $form->error($model,'product_pn'); ?>
        <?php 
        	if($model->product_pn=='')
        		echo CHtml::button('Browse',array('id'=>'getProduct','onclick'=>'$("#mydialog2").dialog("open"); return false;'));
         ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'additional'); ?>
		<?php echo $form->textField($model,'additional',array('value'=>'-','size'=>40,'maxlength'=>40)); ?>
		<?php //echo $form->error($model,'additional'); ?>
	</div>
    <div class="row">
		<?php echo $form->labelEx($model,'qty'); ?>
		<?php echo $form->numberField($model,'qty',array('id'=>'qty','placeholder'=>'-','min'=>1,'max'=>999)); ?>
		<?php //echo $form->error($model,'qty'); ?>
	</div>
    <div class="row">
		<?php echo $form->labelEx($model,'uom'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                        'model'=>$model,
                        'attribute'=>'uom',
                        //'id'=>'customerPick',
                        //'name'=>'customer',
                        //'source'=>$this->createUrl('quotationOrderHeader/suggestCountry'),
                        'source'=>array('Ea', 'Pcs', 'Lot', 'm2', 'cm', 'm', 'mm', 'set', 'pail', 'drum', 'cr'),
                        'htmlOptions'=>array(
                            //'size'=>'40',
                            'select'=>"js:function(event, ui) { 
                               // $('#tempIdCust').val(); 
                            }"
                        ),
                        'options'=>array(
                            'minLength'=>'0',
                        ),
                    ));
        ?>
		<?php //echo $form->error($model,'uom'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'unit_sell'); ?>
		<?php echo CHtml::textField('unit_sell',$unit_sell,array('id'=>'unit_sell', 'readonly'=>'readonly')); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'total'); ?>
		<?php echo CHtml::textField('total',$total,array('id'=>'total', 'readonly'=>'readonly')); ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->